mir: skip windows that aren't visible
authorWilliam Hua <william@attente.ca>
Wed, 3 Dec 2014 16:30:34 +0000 (11:30 -0500)
committerWilliam Hua <william@attente.ca>
Thu, 5 Feb 2015 16:26:18 +0000 (17:26 +0100)
gdk/mir/gdkmir-private.h
gdk/mir/gdkmireventsource.c
gdk/mir/gdkmirwindowimpl.c

index 7654e083d4366b65175e4df2ba9c2708ca032d4d..ca8d239c1645d74cc6d077b7cb89e48b6a23ec12 100644 (file)
@@ -134,10 +134,10 @@ void _gdk_mir_print_resize_event (const MirResizeEvent *event);
 void _gdk_mir_print_event (const MirEvent *event);
 
 /* TODO: Remove once we have proper transient window support. */
-GdkWindow * _gdk_mir_window_get_transient_child (GdkWindow *window,
-                                                 gint       x,
-                                                 gint       y,
-                                                 gint      *out_x,
-                                                 gint      *out_y);
+GdkWindow * _gdk_mir_window_get_visible_transient_child (GdkWindow *window,
+                                                         gint       x,
+                                                         gint       y,
+                                                         gint      *out_x,
+                                                         gint      *out_y);
 
 #endif /* __GDK_PRIVATE_MIR_H__ */
index 7e4b9d0c72e63d76bb20dcc46bf2c640ba461500..68b04308e2f0ba53eaa032448659ee5fb9c7a45c 100644 (file)
@@ -473,7 +473,7 @@ gdk_mir_event_source_convert_events (GdkMirEventSource *source)
               x = event->event.motion.pointer_coordinates[0].x;
               y = event->event.motion.pointer_coordinates[0].y;
 
-              child = _gdk_mir_window_get_transient_child (window, x, y, &x, &y);
+              child = _gdk_mir_window_get_visible_transient_child (window, x, y, &x, &y);
 
               if (child && child != window)
                 {
index 78c51118eed2cc354606ab35fb29869aaba97ed9..d62a24aab4cb2cfbae02aca46c38beabbf41a70e 100644 (file)
@@ -912,11 +912,11 @@ gdk_mir_window_impl_set_transient_for (GdkWindow *window,
 
 /* TODO: Remove once we have proper transient window support. */
 GdkWindow *
-_gdk_mir_window_get_transient_child (GdkWindow *window,
-                                     gint       x,
-                                     gint       y,
-                                     gint      *out_x,
-                                     gint      *out_y)
+_gdk_mir_window_get_visible_transient_child (GdkWindow *window,
+                                             gint       x,
+                                             gint       y,
+                                             gint      *out_x,
+                                             gint      *out_y)
 {
   GdkMirWindowImpl *impl = GDK_MIR_WINDOW_IMPL (window->impl);
   GdkWindow *child = NULL;
@@ -930,7 +930,10 @@ _gdk_mir_window_get_transient_child (GdkWindow *window,
   y -= window->y;
 
   for (i = impl->transient_children; i && !child; i = i->next)
-    child = _gdk_mir_window_get_transient_child (i->data, x, y, out_x, out_y);
+    {
+      if (GDK_MIR_WINDOW_IMPL (GDK_WINDOW (i->data)->impl)->visible)
+        child = _gdk_mir_window_get_visible_transient_child (i->data, x, y, out_x, out_y);
+    }
 
   if (child)
     return child;